#ifndef __BEEP_LED_HPP__
#define __BEEP_LED_HPP__

#include <iostream>
#include <string>

extern "C"
{
#include <rtthread.h>
#include <rtdevice.h>
#include <stdint.h>
}

typedef struct
{
    uint32_t times;
    uint32_t active_time;
    uint32_t idle_time;
}beep_led_mail,*Pbeep_led_mail;

typedef enum
{
    beep_led_status_fail,
    beep_led_status_ok,
} beep_led_status;

typedef enum
{
    beep_led_active_LOW,//低电平响
    beep_led_active_HIGH,//高电平响
} beep_led_active_mode;

typedef enum
{
    beep_led_working_mode_brust,//每次收到都执行一次
    beep_led_working_mode_continue,//每次收到更改循环状态
} beep_led_working_mode;



class BEEP_LED
{
private:
    rt_base_t pin_num; //使用GET_PIN传入
    beep_led_active_mode mode;
    beep_led_working_mode working_mode;
    rt_mailbox_t mail;

    beep_led_status init_flag;

public:
    BEEP_LED(rt_base_t pin_num,beep_led_active_mode mode,beep_led_working_mode working_mode);
    ~BEEP_LED();

    void BEEP_LED_in_thread();
    beep_led_status BEEP_LED_send_beep(uint32_t times,uint32_t active_time,uint32_t idle_time);// 次数 活跃时间 idle时间

    beep_led_status BEEP_LED_read_init_status();

};

#endif /*__BEEP_HPP__*/

